// import React from 'react';



import React from 'react'
import { Button } from 'antd';
export default function Gooutfile(props) {
    const exportToJSON = () => {
    const json = JSON.stringify(props.data);
    const blob = new Blob([json], { type: 'application/json' });
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.setAttribute('hidden', '');
    a.setAttribute('href', url);
    a.setAttribute('download', 'data.json');
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
  };
  return (
    <div>
       <div>
        <Button type="primary" onClick={exportToJSON}>
        导出
      </Button>
    </div>
    </div>
  )
}
